package com.msb.mallthird.controller;

import com.msb.common.utils.R;
import com.msb.mallthird.utils.SmsComponent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: xixifeng
 * @Date: 2022/11/5 - 11 - 05 - 15:18
 * @Description: com.msb.mallthird.controller
 * @version: 1.0
 */

@RestController
public class smsController {


    @Autowired
    SmsComponent smsComponent;

    /**
     * 调用短信服务商提供的短信API发送短信
     * @param phone
     * @param code
     * @return
     */
    @GetMapping("/sms/sendCode")
    public R sendSmsCode(@RequestParam("phone") String phone,@RequestParam("code") String code){

        smsComponent.sendSmsCode(phone,code);

        return R.ok();
    }

}
